asm
  ld sp,$23FF
  end asm

#include "./library/smsrnd.bas"
#include "./library/b2r1f1sx_charmapdaisanwakuseimeteor.zxi"

dim seed as uinteger at $2010
dim eee as uinteger at $2012
dim ee0 as uinteger at $2014
dim ee1 as uinteger at $2016
dim ee2 as uinteger at $2018
dim ee3 as uinteger at $201A
dim ex0 as uinteger at $201C
dim ey0 as uinteger at $201E


sub daisanwakuseimeteorputchar(txp1 as uinteger,typ1 as uinteger,tch1 as uinteger,tad1 as uinteger):
  dim tlp1 as uinteger at $2000
  for tlp1=0 to 7
    poke $8001+0+(typ1 bxor 31)*2+tlp1*64+txp1*512,peek(@charmap01+(tch1*16)+(tlp1*2)+1)
    poke $8001+1+(typ1 bxor 31)*2+tlp1*64+txp1*512,peek(@charmap01+(tch1*16)+(tlp1*2)+0)
    next
  end sub

seed=0

eee=0
for ee1=1 to 31
  for ee0=1 to 30
    seed=smsrnd(seed)
    daisanwakuseimeteorputchar(ee0,ee1,96+seed mod 9,@charmap01)
    next:next

for ee1=1 to 15
  for ee0=1 to 15
    seed=smsrnd(seed)
    daisanwakuseimeteorputchar(ee0+14,ee1+15,ee1*16+ee0,@charmap01)
    next:next


eee=0:ex0=8:ey0=8
do

daisanwakuseimeteorputchar(2,2,48+int(eee/10000) mod 10,@charmap01)
daisanwakuseimeteorputchar(3,2,48+int(eee/1000) mod 10,@charmap01)
daisanwakuseimeteorputchar(4,2,48+int(eee/100) mod 10,@charmap01)
daisanwakuseimeteorputchar(5,2,48+int(eee/10) mod 10,@charmap01)
daisanwakuseimeteorputchar(6,2,48+eee mod 10,@charmap01)

ee0=peek($2400)
daisanwakuseimeteorputchar(4,4,48+int(ee0/100) mod 10,@charmap01)
daisanwakuseimeteorputchar(5,4,48+int(ee0/10) mod 10,@charmap01)
daisanwakuseimeteorputchar(6,4,48+ee0 mod 10,@charmap01)

ey0=ey0-((ee0 band 1)/1)+((ee0 band 2)/2)

ee0=peek($2800)
daisanwakuseimeteorputchar(4,5,48+int(ee0/100) mod 10,@charmap01)
daisanwakuseimeteorputchar(5,5,48+int(ee0/10) mod 10,@charmap01)
daisanwakuseimeteorputchar(6,5,48+ee0 mod 10,@charmap01)

ex0=ex0+((ee0 band 64)/64)-((ee0 band 128)/128)


daisanwakuseimeteorputchar(ex0,ey0,eee band 127,@charmap01)

eee=eee+1
loop


do:loop




eee=0
for ee1=1 to 31
  for ee0=1 to 30
    seed=smsrnd(seed)
    for ee2=0 to 7
      for ee3=0 to 1
        poke $8001+ee3+(ee1 bxor 31)*2+ee2*64+ee0*512,peek(@charmap01+((eee mod 105)*16)+(ee2*2)+(ee3 bxor 1))
        next:next
    daisanwakuseimeteorputchar(15,15,eee band 255,@charmap01)
    eee=eee+1
    next:next

do:loop


'do:loop

eee=0
for ee1=1 to 31
  for ee0=1 to 30
    seed=smsrnd(seed)
    for ee2=0 to 7
      for ee3=0 to 1
        poke $8001+ee3+(ee1 bxor 31)*2+ee2*64+ee0*512,peek(@charmap01+((eee mod 105)*16)+(ee2*2)+(ee3 bxor 1))
        next:next
    eee=eee+1
    next:next

do:loop

for ee1=0 to 31
  for ee0=0 to 31
    seed=smsrnd(seed)
    for ee2=0 to 7
      for ee3=0 to 1
        poke $8001+ee3+(ee1 bxor 31)*2+ee2*64+ee0*512,peek(@charmap01+((seed mod 64)*16)+(ee2*2)+(ee3 bxor 1))
        next:next:next:next

for ee1=0 to 31
  for ee0=0 to 31
    for ee2=0 to 7
      for ee3=0 to 1
        seed=smsrnd(seed)
        poke $8000+ee3+(ee1 bxor 31)*2+ee2*64+ee0*512,seed
        next:next:next:next

do:loop


test01a:
asm
defb %1110,%1111
defb %1110,%1111
defb %1000,%1000
defb %1000,%1000
defb %1000,%1000
defb %1000,%1111
defb %0000,%0111
defb %0000,%0000


end asm









do


loop




do
for eee=$8000 to $BFFF
  seed=smsrnd(seed)
  poke eee,seed
  next

loop




